export function preventDefault(event: Event, isStopPropagation?: boolean) {
  if (typeof event.cancelable !== "boolean" || event.cancelable) {
    event.preventDefault();
  }

  if (isStopPropagation) {
    event.stopPropagation();
  }
}

export const clamp = (num: number, min: number, max: number): number =>
  Math.min(Math.max(num, min), max);
